{% extends "base.html" %}
{% block header %}
<script type="text/javascript">
var server_id='{{ server_id }}';
function checkStatus(){
    setTimeout(function(){
        $.get('/server/'+server_id,{},function(info){
            try{
                if(info.server.status=="ACTIVE"){
                    $("#sp_status").html("激活成功");
                    setTimeout(
                            function(){
                                location.reload();
                            },1000);
                }else{
                    checkStatus();
                }
            }catch(e){
                alert(e);
            }
        });
    },10000);
}
$(function(){
    {% if need_check %}
    checkStatus();
    {% endif %}
});
</script>
{% endblock %}
{% block content %}
    <a href="/vps/list">返回租户所有服务器列表</a>
    <div id="waiting" class="well" {% if need_check %}{% else %}style="display: none;"{% endif %}>
        <img src="/static/img/loading.gif" /> <span id="sp_status">正在初始化......</span>
    </div>
    <div id="server_ppt" {% if need_check %} style="display: none;"{% endif %}>
    <table class="table">
        <thead>
            <tr>
                <th>属性</th>
                <th>值</th>
            </tr>
        </thead>
        <tbody>
            {% for ppt in ppts %}
            <tr>
                <td>{{ ppt.key }}</td>
                <td>{{ ppt.value }}</td>
            </tr>
            {% endfor %}
        </tbody>
    </table>

    </div>

{% endblock %}